﻿CREATE PROCEDURE [ServiceEngine].[ListEntityGroups]
  @entityTypeID smallint 
AS
BEGIN
 SET NOCOUNT ON;

 SELECT 
  N.[EntityID] as ID, 
  N.[EntityName] as [Name], 
  N.EntityDescription as Description
 FROM [ServiceEngine].Names N 
 JOIN [ServiceEngine].EntityGroups EG ON EG.EntityGroupID = N.[EntityID] 
 WHERE EG.EntityTypeID = @entityTypeID
END
